#include<bits/stdc++.h>
using namespace std;
const int NN=2e5+4;
int a[NN],b[NN],ans[NN];
int main()
{
	freopen("min.in","r",stdin);
	freopen("min.out","w",stdout);
	int n;
	scanf("%d",&n);
	for(int i=1;i<=n;i++)
		scanf("%d",&a[i]);
	for(int i=1;i<=n;i++)
		scanf("%d",&b[i]);
	for(int i=1;i<=n;i++)
		ans[i]=1e9;
	for(int i=1;i<=n;i++)
	{
		int minna=1e9,minnb=1e9;
		for(int j=i;j<=n;j++)
		{
			minna=min(minna,a[j]);
			minnb=min(minnb,b[j]);
			ans[j-i+1]=min(ans[j-i+1],abs(minna-minnb));
		}
	}
	for(int i=1;i<=n;i++)
		printf("%d\n",ans[i]);
	return 0;
}
